<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@include file="/common/mytags.jsp" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>用户菜单权限管理</title>
    <link rel="stylesheet" type="text/css" href="<%=basePath%>common/frame/layui/css/layui.css" media="all">
    <link rel="stylesheet" type="text/css" href="<%=basePath%>common/css/gobal.css" media="all">
    <link rel="stylesheet" type="text/css" href="<%=basePath%>backstage/css/backstage.css" media="all">
</head>
<body>

<div class="layui-layout layui-layout-admin larrycms-admin" id="larry_admin_out">
    <!-- 顶部导航 -->
    <div class="layui-header larrycms-header">
        <div class="layui-logo larrycms-logo">菜单权限管理</div>
        <!-- 右侧 -->
        <div class="larrycms-top pos-a">
            <div class="menu-switch pos-a" id="menuSwitch"><i class="larry-icon pos-a fz20">&#xe6d6;</i></div>
            <div class="menu-mobile pos-a" id="larryMobile"><i class="larry-icon pos-a fz20">&#xe6d6;</i></div>
            <!-- 顶级菜单 -->
            <div class="inline-block larrycms-top-menu pos-a">
                <ul class="layui-nav clearfix" id="larry_top_menu" lay-filter="TopMenu">
                    <!-- 此次动态生成 -->
                </ul>
            </div>
            <!-- 右侧常用菜单 -->
            <div class="inline-block larrycms-offten-menu pos-a">
                <ul class="layui-nav clearfix">
                    <li class="layui-nav-item">
                        <a id="FullScreen" class="onFullScreen"><i class="larry-icon">&#xe604;</i>全屏</a>
                    </li>
                    <li class="layui-nav-item ">
                        <a id="larryTheme"><i class="larry-icon">&#xe66f;</i><cite>设置主题</cite></a>
                    </li>
                </ul>
            </div>
        </div>
    </div>
    <!-- 左侧区域 -->
    <div class="layui-side pos-a larrycms-left layui-bg-black" id="larry_left">
        <div class="layui-side-scroll">
            <!-- 管理员信息      -->
            <div class="user-info">
                <div class="photo" <c:if test="${requestScope.menuCount<=0}">id="pentPic"</c:if> >
                	<c:if test="${empty sessionScope.manager_portrait }">
                    <img id="admin-photo"  src="<%=basePath%>backstage/images/user.jpg" alt="用户头像" title="用户头像">
                    </c:if>
                	<c:if test="${not empty sessionScope.manager_portrait }">
                    <img id="admin-photo"  src="${sessionScope.manager_portrait }" alt="用户头像" title="用户头像">
                    </c:if>
                </div>
                <p><span style="color: orange;">${sessionScope.user_name}</span> 您好！欢迎登录</p>
            </div>
            <!-- 系统菜单 -->
            <div class="sys-menu-box">
                <ul class="layui-nav layui-nav-tree" id="larry_left_menu" lay-filter="LarrySide" data-group='0'>
                    <!-- 此次动态生成 -->
                </ul>
            </div>
        </div>
    </div>
    <!-- 内容主体区域 -->
    <div class="layui-body pos-a larrycms-body" id="larry_body">
        <div class="layui-tab larrycms-tab" id="larry_tab" lay-filter="larryTab">
            <div class="larrycms-title-box"></div>
            <div class="go-left">
                <div class="key-press pressKey" id="titleLeft" title="滚动至最右侧"><i class="larry-icon">&#xe6fd;</i></div>
            </div>
            <ul class="layui-tab-title larrycms-tab-title" lay-allowclose="true" id="larry_tab_title"
                lay-filter="subadd">
                <li class="layui-this" id="admin-home" lay-id="0" fresh="1">
                    <i class="larry-icon">&#xe697;</i><em>后台首页</em>
                </li>
            </ul>
            <div class="title-right" id="titleRbox">
                <div class="go-right key-press pressKey" id="titleRight" title="滚动至最左侧">
                    <i class="larry-icon">&#xe6fb;</i>
                </div>
                <div class="refresh key-press" id="refresh_iframe">
                    <i class="layui-icon layui-anim layui-anim-rotate layui-anim-loop">&#xe669;</i>
                    <cite>刷新</cite>
                </div>
                <div class="often key-press" lay-filter="larryOperate" id="buttonRCtrl">
                    <ul class="layui-nav pos-r">
                        <li class="layui-nav-item pos-a">
                            <a class="top"><i class="larry-icon">&#xe705;</i><cite>常用操作</cite><span
                                    class="layui-nav-more"></span></a>
                            <dl class="layui-nav-child layui-anim layui-anim-upbit">
                                <dd>
                                    <a id="userInfo" ><i class="larry-icon">&#xe615;</i><cite>我的个人信息</cite></a>
                                </dd>
                                <dd>
                                    <a id="userPic" ><i class="larry-icon">&#xe672;</i><cite>更换个人头像</cite></a>
                                </dd>
                                <dd>
                                    <a id="pwd" ><i class="larry-icon">&#xe673;</i><cite>修改登陆密码</cite></a>
                                </dd>
                                <dd>
                                    <a id="logout" ><i class="larry-icon">&#xe62c;</i><cite>退出当前系统</cite></a>
                                </dd>

                            </dl>
                        </li>
                    </ul>
                </div>
            </div>
            <div class="layui-tab-content" id="larry_tab_content">
                <div class="layui-tab-item layui-show">
                    <iframe class="larry-iframe" id="iframeHeight" data-id='0' name="ifr_0" id='ifr0'
                        src="<%=basePath%>user/welcome/jsp"></iframe>
                </div>
            </div>
        </div>
    </div>
    <!-- 底部固定区域 -->
    <div class="layui-footer pos-a larrycms-footer" id="larry_footer">
        <div class="layui-main">
            <p class="inline-block">©2018-2028   <a href="http://www.dckeji.cn" target="_blank" class="fp">dckeji.cn</a>
                作者：江苏点创信息科技有限公司</p>
            <%--<button class="layui-btn layui-btn-small" id="dianzhan">
            <i class="larry-icon">&#xe64c;</i> 打赏作者
            </button>--%>
        </div>
    </div>
</div>
<!-- 加载js文件-->
<script type="text/javascript">
    (function (e) {
        "use strict";
        var n = n || {};

        function i(e) {
            if (typeof e === "function") {
                e = {onchange: e}
            }
            e = e || {};
            var n = e.delay || 1e3;
            var i = {};
            i.onchange = e.onchange;
            var o;
            var r = new Image;
            r.__defineGetter__("id", function () {
                o = "on"
            });
            var t = "unknown";

            function f() {
                return t
            }

            i.getStatus = f;
            function u() {
                if (window.Firebug && window.Firebug.chrome && window.Firebug.chrome.isInitialized) {
                    a("on");
                    return
                }
                o = "off";
                console.log(r);
                console.clear();
                a(o)
            }

            function a(e) {
                if (t !== e) {
                    t = e;
                    if (typeof i.onchange === "function") {
                        i.onchange(e)
                    }
                }
            }

            var c = setInterval(u, n);
            window.addEventListener("resize", u);
            var d;

            function l() {
                if (d) {
                    return
                }
                d = true;
                window.removeEventListener("resize", u);
                clearInterval(c)
            }

            i.free = l;
            return i
        }

        n.create = i;
        if (typeof define === "function") {
            if (define.amd || define.cmd) {
                define(function () {
                    return n
                })
            }
        } else if (typeof module !== "undefined" && module.exports) {
            module.exports = n
        } else {
            window[e] = n
        }
    })("larry");
</script>
<script type="text/javascript">
    layui.config({
        base: "<%=basePath%>common/larrylib/",
        version: '201708031'
    }).use(["jquery", "layer", "element", "common"], function () {
        var r = layui.$,
            o = layui.layer,
            e = layui.common,
            i = layui.device(),
            l = layui.element;
        r(document).ready(function () {
            if (i.ie && i.ie < 9) {
                e.larryCmsError("本系统最低支持ie8，您当前使用的是古老的 IE" + i.ie + "！ \n 建议使用IE9及以上版本的现代浏览器", e.larryCore.tit)
            }
            if (i.android || i.ios) {
                if (r("#larry_admin_out").length > 0) {
                    r("#larry_admin_out").addClass("larry-mobile")
                } else {
                    r("body").addClass("larry-mobile")
                }
            } else {
                if (r("#larry_admin_out").length > 0) {
                    if (r("#larry_admin_out").hasClass("larry-mobile")) {
                        r("#larry_admin_out").removeClass("larry-mobile")
                    }
                } else {
                    if (r("body").hasClass("larry-mobile")) {
                        r("body").removeClass("larry-mobile")
                    }
                }
            }
        })
    });
</script>
<script type="text/javascript">
    var larryTab;
    var larryTest = "test";
    layui.use(["jquery", "larryElem", "layer", "common", "form", "larryMenu", "larryTab"], function () {
        var e = layui.$, l = layui.larryElem, n = layui.layer, r = layui.common, a = layui.form, c = layui.larryMenu();
        var width = e(document).width();
        var height = e(document).height();

        e("#pentPic").on("dblclick", function () {
            var e = layui.layer.open({
                title: "系统菜单配置",
                type: 2,
                move: false,
                anim: 1,
                skin: "larry-green",
                offset: '130px',
                area: [width*0.7 + "px", height*0.8 + "px"],
                content: "<%=basePath%>auth/menu/page"
            });
        });

        larryTab = layui.larryTab({
            top_menu: "#larry_top_menu",
            left_menu: "#larry_left_menu",
            larry_elem: "#larry_tab"
        });
        e("body").bind("selectstart", function () {
            return false
        });
        larryTab.menuSet({
            type: "GET",
            url: '<%=basePath%>user/userAuto',
            spreadOne: false,
            topFilter: "TopMenu",
            lefFilter: "LarrySide"
        });
        larryTab.menu();
        e("#larry_top_menu li").on("click", function () {
            var t = e(this).children("a").data("group");
            larryTab.on("click(TopMenu)", t);
            larryTab.on("click(LarrySide)", t, function (e) {
                larryTab.tabAdd(e.field)
            })
        });
        e("#larry_top_menu li").eq(0).click();
        e(document).ready(function () {
            var t = localStorage.getItem("fullscreen_info");
            var l = localStorage.getItem("themeName");
            if (l) {
                e("body").attr("class", "");
                e("body").addClass("larryTheme-" + l)
            }
            if (t && t != "false") {
                var r = n.alert("按ESC退出全屏", {
                    title: "进入全屏提示信息",
                    skin: "layui-layer-lan",
                    closeBtn: 0,
                    anim: 4,
                    offset: "100px"
                }, function () {
                    o();
                    e("#FullScreen").html('<i class="larry-icon larry-quanping"></i>退出全屏');
                    n.close(r)
                })
            }
        });
        e("#refresh_iframe").click(function () {
            e("#larry_tab_content").children(".layui-show").children("iframe")[0].contentWindow.location.reload(true)
        });
        e("#buttonRCtrl").find("dd").each(function () {
            e(this).on("click", function () {
                var t = e(this).children("a").attr("data-eName");
                larryTab.tabCtrl(t)
            })
        });
        e("#clearCached").on("click", function () {
            larryTab.cleanCached();
            n.alert("缓存清除完成!本地存储数据也清理成功！", {icon: 1, title: "系统提示"}, function () {
                location.reload()
            })
        });
        e("#larryTheme").on("click", function () {
            var t = localStorage.getItem("fullscreen_info");
            var l = localStorage.getItem("themeName");
            n.open({
                type: 1,
                title: false,
                closeBtn: true,
                shadeClose: false,
                shade: .35,
                area: ["490px", "365px"],
                isOutAnim: true,
                resize: false,
                anim: Math.ceil(Math.random() * 6),
                content: e("#LarryThemeSet").html(),
                success: function (n, r) {
                    if (t && t != "false") {
                        e("input[lay-filter='fullscreen']").attr("checked", "checked")
                    }
                    if (l) {
                        e("#themeName option[value='" + l + "']").attr("selected", "selected")
                    }
                    a.render()
                }
            });
            a.on("switch(fullscreen)", function (e) {
                var t = e.elem.checked;
                localStorage.setItem("fullscreen_info", t)
            });
            a.on("switch(tabSession)", function (e) {
                var t = e.elem.checked;
                localStorage.setItem("tabSessions", t)
            });
            a.on("switch(autoRefresh)", function (e) {
                var t = e.elem.checked;
                localStorage.setItem("autoRefresh", t)
            });
            a.on("select(larryTheme)", function (t) {
                var n = t.value;
                localStorage.setItem("themeName", n);
                if (l) {
                    e("body").attr("class", "");
                    e("body").addClass("larryTheme-" + l)
                }
                a.render("select")
            });
            return false
        });
        e("#FullScreen").bind("click", function () {
            var t = document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement;
            if (t == null) {
                o();
                e(this).html('<i class="larry-icon">&#xe604;</i>退出全屏')
            } else {
                i();
                e(this).html('<i class="larry-icon">&#xe604;</i>全屏')
            }
        });
        function o() {
            var e = document.documentElement;
            if (e.requestFullScreen) {
                e.requestFullScreen()
            } else if (e.mozRequestFullScreen) {
                e.mozRequestFullScreen()
            } else if (e.webkitRequestFullScreen) {
                e.webkitRequestFullScreen()
            }
        }

        function i() {
            var e = document;
            if (e.exitFullscreen) {
                e.exitFullscreen()
            } else if (e.mozCancelFullScreen) {
                e.mozCancelFullScreen()
            } else if (e.webkitCancelFullScreen) {
                e.webkitCancelFullScreen()
            }
        }

        e("#dianzhan").click(function (e) {
            n.open({
                type: 1,
                title: false,
                closeBtn: true,
                shadeClose: false,
                shade: .75,
                area: ["540px", "540px;"],
                content: '<img  width="540px" higth="540px" src="<%=basePath%>backstage/images/dashang.png"/>'
            });
        });


        e("#logout").on("click", function () {
            var e = "<%=basePath%>user/logOut";
            console.log(e);
            r.logOut("退出登陆提示！", "你真的确定要退出系统吗？", e)
        });
        e("#pwd").on("click", function () {
            var e = layui.layer.open({
                title: "修改登陆密码",
                type: 2,
                move: false,
                anim: 1,
                skin: "larry-green",
                offset: '230px',
                /* area: [width / 1.73 + "px", height*0.7 + "px"],*/
                area: [width / 3 + "px", height*0.35 + "px"],
                content: "<%=basePath%>user/to/update/pwd"
            });
        });
        e("#userPic").on("click", function () {
            var e = layui.layer.open({
                title: "更换个人头像",
                type: 2,
                move: false,
                anim: 1,
                skin: "larry-green",
                area: [width / 3 + "px", height*0.6 + "px"],
                content: "<%=basePath%>user/to/update/pic"
            });
        });
        e("#userInfo").on("click", function () {
            var e = layui.layer.open({
                title: false,
                type: 2,
                move: false,
                anim: 5
                ,shade:0.3,
                area: [width / 2.5 + "px", height*0.27 + "px"],
                content: "<%=basePath%>user/info"
            });
        });

        var u = [[{
            text: "刷新当前页", func: function () {
                e(".layui-tab-content .layui-tab-item").each(function () {
                    if (e(this).hasClass("layui-show")) {
                        e(this).children("iframe")[0].contentWindow.location.reload(true)
                    }
                })
            }
        }, {
            text: "重载主框架", func: function () {
                document.location.reload()
            }
        }, {
            text: "设置系统主题", func: function () {
                e("#larryTheme").trigger("click")
            }
        }, {
            text: "选项卡常用操作", data: [[{
                text: "定位当前选项卡", func: function () {
                    e("#tabCtrD").trigger("click")
                }
            }, {
                text: "关闭当前选项卡", func: function () {
                    e("#tabCtrA").trigger("click")
                }
            }, {
                text: "关闭其他选项卡", func: function () {
                    e("#tabCtrB").trigger("click")
                }
            }, {
                text: "关闭全部选项卡", func: function () {
                    e("#tabCtrC").trigger("click")
                }
            }]]
        }]];
        c.ContentMenu(u, {name: "body"}, e("body"));
        e("#larry_body").mouseover(function () {
            c.remove()
        });
        e(".pressKey").on("click", function () {
            var t = parseInt(e("#larry_tab").width() - 270);
            var l = e("#larry_tab").find("li"), r = 0;
            l.each(function (t, l) {
                r += e(l).outerWidth(true)
            });
            if (t >= r) {
                n.tips("当前没有可移动的选项卡！", e(this), {tips: [3, "#FF5722"]})
            }
        });
        e("#lock").mouseover(function () {
            n.tips("请按Alt+L快速锁屏！", "#lock", {tips: [1, "#FF5722"], time: 1500})
        });
        e(document).keydown(function (e) {
            if (e.altKey && e.which == 76) {
                f()
            }
        });
        var s = 0;

        function f() {
            var t = "<%=basePath%>backstage/datas/lock.json";
            s = 1;
            e.post(t, function (e) {
                if (e.lock) {
                    d(s)
                } else {
                    n.alert("锁屏失败，请稍后再试！")
                }
            });
            y()
        }

        e("#lock").click(function () {
            f()
        });
        e("#unlock").click(function () {
            m()
        });
        function m() {
            if (e("#unlock_pass").val() == "larrycms") {
                s = 0;
                d(s);
                return
            } else {
                n.tips("输入密码解锁", e("#unlock"), {tips: [3, "#FF5722"], time: 1e3});
                return
            }
        }

        e("#unlock_pass").keypress(function (e) {
            if (window.event && window.event.keyCode == 13) {
                m();
                return false
            }
        });
        function y() {
            var l = new Date;
            var n = l.getHours();
            var r = l.getMinutes();
            var a = l.getSeconds();
            r = r < 10 ? "0" + r : r;
            a = a < 10 ? "0" + a : a;
            e("#time").html(n + ":" + r + ":" + a);
            t = setTimeout(function () {
                y()
            }, 500)
        }

        function d(t) {
            if (t == 1) {
                e(".lock-screen").show();
                e("#locker").show();
                e("#larry_admin_out").hide();
                e("#lock_password").val("")
            } else {
                e(".lock-screen").hide();
                e("#locker").hide();
                e("#larry_admin_out").show()
            }
        }

        e("#larryMobile").on("click", function () {
            if (e(".larry-mobile #larry_left").css("display") == "none") {
                e(".larry-mobile #larry_left").show()
            } else {
                e(".larry-mobile #larry_left").hide()
            }
            if (e(".larry-mobile .larrycms-top-menu").css("display") == "none") {
                e(".larry-mobile .larrycms-top-menu").show()
            } else {
                e(".larry-mobile .larrycms-top-menu").hide()
            }
        })
    });
</script><!-- 主题配置 -->
<div class="larryThemeContent" id="LarryThemeSet" style="display:none;">
    <div class="larry-theme-form">
        <h3>系统主题预设</h3>
        <form action="" class="layui-form larry-theme-con">
            <div class="layui-form-item select-theme">
                <label class="layui-form-label">主题选择</label>
                <div class="layui-input-block">
                    <select lay-filter="larryTheme" lay-verify="" id="themeName">
                        <option value="larry">默认主题</option>
                        <option value="A">深蓝主题</option>
                        <option value="B">墨绿主题</option>
                        <option value="C">藏青主题</option>
                        <option value="larry_">我要自定义主题</option>
                    </select>
                </div>
            </div>
            <div class="layui-form-item fullscreen">
                <label class="layui-form-label">是否全屏</label>
                <div class="layui-input-block">
                    <input type="checkbox" id="checkboxfull" lay-filter="fullscreen" lay-skin="switch" value="1">
                </div>
            </div>
            <div class="layui-form-item submit-form">
                <button class="layui-btn larry-button" lay-submit="" lay-filter="submitlocal">立即设置主题</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置当前修改</button>
            </div>
        </form>
    </div>
</div>
<!-- 屏幕锁屏 -->
<div class="lock-screen" style="display: none;">
    <div class="lock-wrapper" id="lock-screen">
        <div id="time"></div>
        <div class="lock-box">
            <img src="<%=basePath%>backstage/images/login_user.png" alt="">
            <h1>admin</h1>
            <form action="" class="layui-form lock-form">
                <div class="layui-form-item">
                    <input type="password" id="unlock_pass" name="lock_password" lay-verify="pass"
                           placeholder="锁屏状态，请输入密码解锁" autocomplete="off" class="layui-input" autofocus="">
                </div>
                <div class="layui-form-item">
                    <span class="layui-btn larry-btn" id="unlock">立即解锁</span>
                </div>
            </form>
        </div>
    </div>
</div>
<div style="display: none;">
    <script>
        var _hmt = _hmt || [];
        (function () {
            var hm = document.createElement("script");
            hm.src = "https://hm.baidu.com/hm.js?683b4c583c6d476ef94189e9316d1ad4";
            var s = document.getElementsByTagName("script")[0];
            s.parentNode.insertBefore(hm, s);
        })();
        
        
    </script>
</div>
</body>
</html>